﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using ARchGL.Platform.Core;
using ARchGL.Platform.EntityFrameworkCore;

namespace ARchGL.Platform.Mappings
{
    public class NoticesMapping : IEntityTypeConfiguration<Notices>
    {
        public void Configure(EntityTypeBuilder<Notices> builder)
        {
            //builder.ToTable(MappingConsts.Prefix + nameof(Notices));

            builder.Property(p => p.Title).HasMaxLength(500);
            builder.Property(p => p.Content);
        }
    }

    public class NoticesUserMapping : IEntityTypeConfiguration<NoticesUsers>
    {
        public void Configure(EntityTypeBuilder<NoticesUsers> builder)
        {
            //builder.ToTable(MappingConsts.Prefix + nameof(NoticesUsers));

            builder.Property(x => x.Status).HasDefaultValue(1);
        }
    }
}
